#!/usr/bin/env python
# -*- coding:utf-8 -*-

from flask_restful import Api

from . import sysadmin_blueprint
from api.sysAdminResource.sysAdminResource import SysAdminResource
from api.sysAdminResource.sysAdminOtherResource import SysAdminOtherResource

api = Api(sysadmin_blueprint)

api.add_resource(SysAdminResource, 
                '/sys_admin/<user_id>',  # 获取/更新/删除单个管理员
                '/sys_admin',            # 获取管理员列表/添加管理员
                '/sys_admin/login',      # 登录
                endpoint='SysAdmin')

@sysadmin_blueprint.route('/sysadmin/update/<user_id>', methods=['PUT'], endpoint='SysAdminUpdate')
def update(user_id):
    return SysAdminOtherResource.sensitive_update(user_id)
